package org.aphelie.chronicle.character.ui.editors;

import org.aphelie.chronicle.ArcTopic;
import org.aphelie.chronicle.ui.editors.ArcSheetEditor;
import org.aphelie.chronicle.ui.forms.ArcTopicPage;
import org.eclipse.ui.PartInitException;

public class CategoryEditor extends ArcSheetEditor {
	
	@Override
	protected void addPages() {
		ArcTopic topic = getEditedSheet();
		while (topic.getGrade() > 2) {
			topic = topic.getTopics().get(0);
		}
		System.out.println("CategoryEditor open " + topic);
		try {
			addPage(new ArcTopicPage(this, topic));
		} catch (PartInitException e) {
			e.printStackTrace();
		}
		
	}

	@Override
	public void doSaveAs() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean isSaveAsAllowed() {
		return false;
	}

}
